package com.lantosec.hmrp.modules.morality.vo;

import java.math.BigDecimal;
import java.util.List;

import com.lantosec.hmrp.modules.morality.entity.MoralityItem;
import com.lantosec.hmrp.core.mvc.BaseVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * <p>
 * 项目定义 VO对象
 * </p>
 *
 * @author AutoCode
 * @since 2020-04-16
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value="MoralityItem对象", description="项目定义")
public class MoralityItemVO extends BaseVO<MoralityItem> {
    private static final long serialVersionUID = 1L;


    public MoralityItemVO(MoralityItem entity){
        this.moralityItemId = entity.getMoralityItemId();
        this.moralityItemName = entity.getMoralityItemName();
        this.moralityItemType = entity.getMoralityItemType();
        this.parentItemId = entity.getParentItemId();
        this.leaf = entity.getLeaf();
        this.itemStandard = entity.getItemStandard();
        this.itemOrder = entity.getItemOrder();
    }

    @Override
    public MoralityItem convertToEntity(){
        return new MoralityItem(this);
    }


    @ApiModelProperty(value = "项目ID")
    private String moralityItemId;

    @ApiModelProperty(value = "项目名称/内容")
    private String moralityItemName;

    @ApiModelProperty(value = "项目类型(1基础项目 2一票认定差项目)")
    private Integer moralityItemType;

    @ApiModelProperty(value = "上级项目ID")
    private String parentItemId;

    @ApiModelProperty(value = "是否末级(0否 1是)")
    private Integer leaf;

    @ApiModelProperty(value = "项目标准分(仅基础项目且为末级时可设置)")
    private BigDecimal itemStandard;

    @ApiModelProperty(value = "排序")
    private Integer itemOrder;

    private List<MoralityItemVO> children;
}
